<script>
// 导入储存信息
import Storages from '@/utils/storages'

	export default {
		onLaunch: function() {
			// 判断是否登录
			const userInfo = uni.getStorageSync(Storages.UserInfo.userInfo)
			if(!userInfo) {
				uni.navigateTo({
					url: '/pages/my/login/index'
				})
			} else {
				// 变色
				console.log('你已经登录 欢迎回来 %c' + userInfo.username, 'color: red; font-weight: bold;')
			}
		},
		onShow: function() {
			console.log('碎嘴子乐园显示')
		},
		onHide: function() {
			console.log('碎嘴子乐园隐藏')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import '@/static/icon/iconfont.css';
</style>
